using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using Microsoft.VisualBasic;
using System.Collections;
using System.Diagnostics;
using System;


public partial class GoToDialog
{

    public string Res = "Cancel";
    public string line = "1";

    public GoToDialog()
    {
        InitializeComponent();
    }
    public void OKButton_Click(System.Object sender, RoutedEventArgs e)
    {
        Res = "OK";
        Close();
    }

    public void TextBox1_KeyDown(object sender, KeyEventArgs e)
    {
        if (e.Key == Key.Enter && OKButton.IsEnabled)
        {
            OKButton_Click(null, null);
        }
    }

    public void TextBox1_TextChanged(object sender, TextChangedEventArgs e)
    {
        try
        {
            line = System.Convert.ToString(Convert.ToInt32(TextBox1.Text));
            OKButton.IsEnabled = true;
        }
        catch (Exception)
        {
            TextBox1.Clear();
            OKButton.IsEnabled = false;
        }
    }

    public void GoToDialog_Loaded(object sender, RoutedEventArgs e)
    {
        if (MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnVista || MS.WindowsAPICodePack.Internal.CoreHelpers.RunningOnWin7)
        {
            AppHelper.ExtendGlassFrame(this, new Thickness(-1, -1, -1, -1));
        }
        TextBox1.Focus();
    }
}

